/**
 * \file array.h
 * \brief Implementation of RScript's array.
 **/

#ifndef R_ARRAY_H
#define R_ARRAY_H

/* For every type, ensure "value.h" is loaded first. */
#include "value.h"

struct RArrayT {
  RValue* contents;
  uint32_t size;
  uint32_t alloc_size;
};

/**
 * \brief Construct a new array.
 **/
#define R_ARRAY_SIZE  1
#define r_array_new() r_array_new_sized(R_ARRAY_SIZE)

/**
 * \brief Construct a new array, with space for alloc_size many items.
 * alloc_size must be at least 1.
 **/
RValue r_array_new_sized(uint32_t alloc_size);

#endif /* R_ARRAY_H */
